package com.wiki.controller;

import com.wiki.domain.User;
import com.wiki.resp.CommonResp;
import com.wiki.service.AdminService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping("/admin")
public class AdminController {
    @Resource
    private AdminService adminService;

    @GetMapping("/getAllUsers")
    public CommonResp list(){
        CommonResp<List<User>> resp =new CommonResp<>();
        List<User> userList = adminService.getAllUsers();
        resp.setContent(userList);
        return resp;
    }



}
